package cn.com.chengmandian.service.erp.constants;

/**
 * Description: cmd-erp-center
 * <p>
 * Created by asus on 2022/3/10 15:09
 */
public enum FileUrlTypeEnum {

    HTTP("http","通过http请求获取文件"),
    HTTPS("https","通过https请求获取文件"),
    LOCAL("local","本地获取文件信息");

    private String code;

    private String name;

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static FileUrlTypeEnum getNameByCode(String code){
        if(code == null){
            return null;
        }else{
            FileUrlTypeEnum[] values = values();
            for(FileUrlTypeEnum fileUrlTypeEnum :values){
                if(fileUrlTypeEnum.getCode().equals(code)){
                    return fileUrlTypeEnum;
                }
            }
        }
        return null;
    }

    FileUrlTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
